{% extends 'preheat/base.html' %}

{% block title %}修改密码 - CDN预热平台{% endblock %}

{% block page_title %}修改密码{% endblock %}

{% block content %}
    <div class="card">
        <div class="card-body">
            <form method="post">
                {% csrf_token %}
                
                <div class="form-group">
                    <label for="id_current_password">当前密码 <span class="text-danger">*</span></label>
                    {{ form.current_password }}
                    {% if form.current_password.errors %}
                        <div class="text-danger">
                            {% for error in form.current_password.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-group">
                    <label for="id_new_password1">新密码 <span class="text-danger">*</span></label>
                    {{ form.new_password1 }}
                    {% if form.new_password1.errors %}
                        <div class="text-danger">
                            {% for error in form.new_password1.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-group">
                    <label for="id_new_password2">确认新密码 <span class="text-danger">*</span></label>
                    {{ form.new_password2 }}
                    {% if form.new_password2.errors %}
                        <div class="text-danger">
                            {% for error in form.new_password2.errors %}
                                {{ error }}
                            {% endfor %}
                        </div>
                    {% endif %}
                </div>
                
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">保存</button>
                    <a href="{% url 'preheat:user_list' %}" class="btn btn-secondary">取消</a>
                </div>
            </form>
        </div>
    </div>
{% endblock %}